from typing import List

from base.http import Request, Response


class Cart:
    def cart_list(self, token) -> List:
        request = Request()
        request.path = '/wx/cart/index'
        request.method = 'get'
        request.headers["X-Litemall-Token"] = token

        r = request.send()
        return r

    def cart_add(self,token, goodsId, number, productId) -> Response:
        request = Request()
        request.path = '/wx/cart/add'
        request.method = 'post'
        request.headers["X-Litemall-Token"] = token
        request.data = {
            'goodsId': goodsId,
            'number': number,
            'productId': productId
        }
        r = request.send()
        return r


if __name__ == "__main__":
    pass
